Embodiments according to the invention relate to devices and methods for bypassing a first program code portion using a replacement program code portion. Some embodiments relate to devices and methods for patching a program code portion stored in a read-only memory (ROM).
Microprocessors are used in a wide range of applications, for example in chip card applications. A microprocessor-based system may comprise a processor or a processor core and a first non-volatile memory device which stores a set of instructions that are to be executed by the processor to provide a desired functionality. The first non-volatile memory device on which the instructions are stored can for example be a read-only memory (ROM), for example a mask programmable read-only memory, which forms part of a same integrated circuit as the processor or which is arranged in the same package as the processor. In such an arrangement the ROM can be created in a same manufacturing process as the processor. However, using a mask programmable ROM has a disadvantage that the set of instructions is frozen and consequently cannot be changed.
Moreover, there are further types of one-time programmable memories, which may be used instead of a mask-programmable read-only memory.
However, it is sometimes desired or necessary to update program code portions in order to correct defects or faults, which are discovered in the program code stored in the ROM after the manufacturing process, or to improve or extend a functionality of the program code.
This is, however, challenging in cases in which it is either impossible, not allowed or undesirable to change a content of the memory in which the program instructions are stored.